<!doctype html>
        <!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en-US"> <![endif]-->
        <!--[if IE 7]>    <html class="lt-ie9 lt-ie8" lang="en-US"> <![endif]-->
        <!--[if IE 8]>    <html class="lt-ie9" lang="en-US"> <![endif]-->
        <!--[if gt IE 8]><!--> <html lang="en-US"> <!--<![endif]-->
<head>
        <!-- META TAGS -->
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        <title>子曰</title>

        <link rel="shortcut icon" href="{$IMG_PATH}favicon.png" />



        
        <!-- script -->
        <script type='text/javascript' src='{$JS_PATH}jquery-1.8.3.min.js'></script>
        <script type='text/javascript' src='{$JS_PATH}jquery.easing.1.34e44.js?ver=1.3'></script>
        <script type='text/javascript' src='{$JS_PATH}prettyphoto/jquery.prettyPhotoaeb9.js?ver=3.1.4'></script>
        <script type='text/javascript' src='{$JS_PATH}jquery.liveSearchd5f7.js?ver=2.0'></script>
        <script type='text/javascript' src='{$JS_PATH}jflickrfeed.js'></script>
        <script type='text/javascript' src='{$JS_PATH}jquery.formd471.js?ver=3.18'></script>
        <script type='text/javascript' src='{$JS_PATH}jquery.validate.minfc6b.js?ver=1.10.0'></script>
        <script type='text/javascript' src='{$JS_PATH}custom5152.js?ver=1.0'></script>


        <!-- Style Sheet-->
        <link type="text/css" rel="stylesheet" href="{$CSS_PATH}stylemotai.css">
        <link rel="stylesheet" href="{$CSS_PATH}style.css"/>
        <link rel='stylesheet' id='bootstrap-css-css'  href='{$CSS_PATH}bootstrap5152.css?ver=1.0' type='text/css' media='all' />
        <link rel='stylesheet' id='responsive-css-css'  href='{$CSS_PATH}responsive5152.css?ver=1.0' type='text/css' media='all' />
        <link rel='stylesheet' id='pretty-photo-css-css'  href='{$JS_PATH}prettyphoto/prettyPhotoaeb9.css?ver=3.1.4' type='text/css' media='all' />
        <link rel='stylesheet' id='main-css-css'  href='{$CSS_PATH}main5152.css?ver=1.0' type='text/css' media='all' />
        <link rel='stylesheet' id='custom-css-css'  href='{$CSS_PATH}custom5152.html?ver=1.0' type='text/css' media='all' />
        <link rel="stylesheet" type="text/css" href="{$CSS_PATH}index.css">

        
        <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
        <script src="{$JS_PATH}html5.js"></script></script>
        <![endif]-->
        
        <!-- 百度编辑器引用文件 -->
        <link href="/umeditor/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
        <!-- <script type="text/javascript" src="/umeditor/third-party/jquery.min.js"></script> -->
        <script type="text/javascript" src="/umeditor/third-party/template.min.js"></script>
        <script type="text/javascript" charset="utf-8" src="/umeditor/umeditor.config.js"></script>
        <script type="text/javascript" charset="utf-8" src="/umeditor/umeditor.min.js"></script>
        <script type="text/javascript" src="/umeditor/lang/zh-cn/zh-cn.js"></script>


    <style type="text/css">
      .hiddens {
        height: 100px; 
        overflow:hidden; 
        text-overflow:ellipsis; 
        display:-webkit-box; 
        -webkit-box-orient:vertical; 
        -webkit-line-clamp:4; 
      }
      .answer-container img {
        max-width: 360px;
      }
      /*修正侧边栏显示问题*/
      .nav-ul li a:before {
        background: none;
      }
    </style>


</head>

<body style="font-family: -apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif; font-size: 15px; color: #262626; -webkit-tap-highlight-color: rgba(0,0,0,0);background: #619ec2">

        <!-- Start of Header -->
        <div class="header-wrapper">
                <header>
                        <div class="container">


                                <div class="logo-container">
                                        <!-- Website Logo -->
                                        <a href="{:url('index/index/index')}"  title="Knowledge Base Theme">
                                                <img width="80" src="{$IMG_PATH}logos.jpg" alt="Knowledge Base Theme">
                                        </a>
                                </div>


                                        <!-- Start of Main Navigation -->
                                        <nav class="main-nav">
                                                <div class="menu-top-menu-container">
                                                        <ul id="menu-top-menu" class="clearfix">
                                                                <li  class="current-menu-item"><a href="{:url('index/index/index')}">首页</a></li>
                                                                <li><a href="{:url('index/question/index')}">问题广场</a></li>
                                                                <!--<li><a href="#">皮肤</a>-->
                                                                        <!--<ul class="sub-menu">-->
                                                                                <!--<li><a href="{:url('index/index/blueIndex')}">蓝色界面</a></li>-->
                                                                                <!--<li><a href="green-skin.html">绿色界面</a></li>-->
                                                                                <!--<li><a href="red-skin.html">红色界面</a></li>-->
                                                                                <!--<li><a href="index.html">默认界面</a></li>-->
                                                                        <!--</ul>-->
                                                                <!--</li>-->
                                                                <li><a href="{:url('aboutus/index/index')}">关于我们</a></li>

                                                                <li><a href="{:url('index/contact/index')}">联系我们</a></li>
                                                                <li>{:$index_name?'<a href='.url("index/Login/info","id=$index_id").'>'.$index_name.'</a> | <a href='.url("index/Login/logout").'>退出</a>':'<a href='.url("index/Login/index").'>登录 </a>'}</li>
                                                        </ul>
                                                </div>


                                        </nav>
                                        <!-- End of Main Navigation -->

                        </div>
                </header>
        </div>
        <!-- End of Header -->

                <!-- Start of Search Wrapper -->
                <div class="search-area-wrapper">
                        <div class="search-area container">
                                <h3 class="search-header">您有一个问题?</h3>

                                <form id="search-form" class="search-form clearfix" method="post" action="{:url('index/question/index')}" autocomplete="off">
                                        <input class="search-term required search-main-like" type="text" id="s" name="s" placeholder="请输入你要查询的内容" title="* Please enter a search term!"  style="height: 48px;"/>
                                        <input class="search-btn" type="submit" value="搜索" />
                                        <div id="search-error-container"></div>
                                </form>
                        </div>
                        <div style="text-align: center;padding-bottom: 30px">
                                <a href="#popup-article" class="btn btn-default btn-large card__link card__readmore">我要提问</a><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                                <a  href="{:url('index/question/index')}" class="btn btn-default btn-large">我要回答</a>
                        </div>
                </div>
                <!-- End of Search Wrapper -->






        {block name="main"}
        <!-- Start of Page Container -->
        <div class="page-container">
                <div class="container" style="margin: 36px auto;">
                        <div class="row">

                                <!-- start of page content -->
                                <div class="span8 main-listing" style="marin:0 12px;padding: 3px;">

                                {volist name="data" id="v"}
                                <article class="format-standard type-post hentry clearfix" style="display: block;margin:12px -12px;padding: 6px 12px; border: 1px solid #ccc;border-radius: 5px;background: rgb(248,248,248);">

                                        <header class="clearfix">

                                                <h3 class="post-title" style="background: none;padding: 0;">
                                                        <img src="/static/upload/{$v['photo']}" width="60px" height="60px" style="display: inline-block;border-radius: 50%;height: 60px;" border="0">
                                                        <a href="{:url('index/question/read','id='.$v['id'])}">{$v['title']}</a>
                                                </h3>


                                                <div class="post-meta clearfix" style="margin-top: -20px;padding-left: 80px;">
                                                        <span class="date">{$v['time']}</span>
                                                        <span class="category"><a href="#" title="View all posts in Server &amp; Database">{$v['uname']}</a></span>
                                                        <span style="display: inline-block;text-align: left; float: right; width: 80px;">
                                                                <i class="laud icon-heart" url="{:url('index/question/likes')}" motion="question" qid="{$v['id']}" ></i>{$v['likes']}</span>
                                                </div><!-- end of post meta -->

                                        </header>

                                        <p style="padding-left:16px; line-height: 25px; font-family: serif; font-size: 14px; color: #666;">{$v['content']}</p>
                                        <a style="display: none; float: right;"  class="card__link card__readmore showContent">展开内容</a>
                                        <div class="card__meta">
                                                <a href="{:url('index/question/read','id='.$v['id'])}"><span class="card__meta-label card__meta-comments">我来回答</span></a>
                                                
                                        </div>

                                </article>
                                {/volist}




                                </div>
                                <!-- end of page content -->


                                <!-- start of sidebar -->
                                <aside class="span4 page-sidebar" style="margin: 0 -8px 0 36px;">

                                        <section class="widget">
                                                <div class="support-widget">
                                                        <h3 class="title">支持</h3>
                                                        <p class="intro">需要更多的支持？ 如果您没有找到答案，请点击右上角联系我们与我们联系以获得进一步的帮助。</p>
                                                </div>
                                        </section>


                                        <section class="widget">
                                                <h3 class="title">热门排行</h3>
                                                <ul class="articles">
                                                        {volist name="top" id="a"}
                                                        <li class="article-entry standard">
                                                                <h4><a href="{:url('index/question/read',['id'=>$a['id']])}">{$a['title']}</a></h4>
                                                                <span class="article-meta"><a href="{:url('index/question/read',['id'=>$a['id']])}" title="View all posts in Server &amp; Database">{$a['time']}</a></span>
                                                                <span class="like-count">{$a['likes']}</span>
                                                        </li>
                                                        {/volist}
                                                </ul>
                                        </section>


                                </aside>
                                <!-- end of sidebar -->
                        </div>
                </div>
        </div>
        <!-- End of Page Container -->
        
        <script type="text/javascript">
                
              $('.laud').click(function (){
                    var str = $(this).attr('motion') == "question" ? '收藏' : '点赞' ;
                    $.ajax({
                        type: 'post',
                        data: {
                                "qid":$(this).attr('qid'),
                                "aid":$(this).attr('aid'),
                                "motion":$(this).attr('motion')
                              },
                        url: $(this).attr('url'),
                        success: function (data) {
                                console.log(data);
                                if (data == '已存在') {
                                  alert('您已'+str+'过，无需重复操作');
                                  return;
                                }else if(data != 1){
                                  alert('操作失败，请重试');
                                  return;
                                }
                                // location = location;
                        },
                        error: function () {
                            alert('执行失败，请重试');
                        }
                    });
              });

        </script>

        {/block}
        <!-- Start of Footer -->
        <footer id="footer-wrapper">
                <div id="footer" class="container">
                        <div class="row">

                                <div class="span3">
                                        <section class="widget">
                                                <h3 class="title">How it works</h3>
                                                <div class="textwidget">
                                                        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </p>
                                                        <p>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. </p>
                                                </div>
                                        </section>
                                </div>

                                <div class="span3">
                                        <section class="widget"><h3 class="title">Categories</h3>
                                                <ul>
                                                        <li><a href="#" title="Lorem ipsum dolor sit amet,">Advanced Techniques</a> </li>
                                                        <li><a href="#" title="Lorem ipsum dolor sit amet,">Designing in WordPress</a></li>
                                                        <li><a href="#" title="Lorem ipsum dolor sit amet,">Server &amp; Database</a></li>
                                                        <li><a href="#" title="Lorem ipsum dolor sit amet, ">Theme Development</a></li>
                                                        <li><a href="#" title="Lorem ipsum dolor sit amet,">Website Dev</a></li>
                                                        <li><a href="#" title="Lorem ipsum dolor sit amet,">WordPress for Beginners</a></li>
                                                        <li><a href="#" title="Lorem ipsum dolor sit amet, ">WordPress Plugins</a></li>
                                                </ul>
                                        </section>
                                </div>

                                <div class="span3">
                                        <section class="widget">
                                                <h3 class="title">Latest Tweets</h3>
                                                <div id="twitter_update_list">
                                                        <ul>
                                                                <li>No Tweets loaded !</li>
                                                        </ul>
                                                </div>
                                                <!-- 有报错 -->
                                                <!-- <script type="text/javascript" >
                                                        getTwitters("twitter_update_list", {
                                                                id: "960development",
                                                                count: 3,
                                                                enableLinks: true,
                                                                ignoreReplies: true,
                                                                clearContents: true,
                                                                template: "%text% <span>%time%</span>"
                                                        });
                                                </script> -->
                                        </section>
                                </div>

                                <div class="span3">
                                        <section class="widget">
                                                <h3 class="title">Flickr Photos</h3>

                                        </section>
                                </div>

                        </div>
                </div>
                <!-- end of #footer -->

                <!-- Footer Bottom -->
                <div id="footer-bottom-wrapper">
                        <div id="footer-bottom" class="container">
                                <div class="row">
                                        <div class="span6">
                                                <p class="copyright">
                                                        Copyright © 2017. GQX 鲁ICP备17045303号-1
                                                </p>
                                        </div>
                                        <div class="span6">
                                                <!-- Social Navigation -->
                                                <ul class="social-nav clearfix">
                                                        <li class="linkedin"><a target="_blank" href="http://www.linkedin.com"></a></li>
                                                        <li class="stumble"><a target="_blank" href="http://www.stumbleupon.com"></a></li>
                                                        <li class="google"><a target="_blank" href="http://www.google.com"></a></li>
                                                        <li class="deviantart"><a target="_blank" href="http://www.deviantart.com"></a></li>
                                                        <li class="flickr"><a target="_blank" href="http://www.flickr.com"></a></li>
                                                        <li class="skype"><a target="_blank" href="http://www.skype.com"></a></li>
                                                        <li class="rss"><a target="_blank" href="http://www.rss.com"></a></li>
                                                        <li class="twitter"><a target="_blank" href="http://www.twitter.com"></a></li>
                                                        <li class="facebook"><a target="_blank" href="http://www.facebook.com"></a></li>
                                                </ul>
                                        </div>
                                </div>
                        </div>
                </div>
                <!-- End of Footer Bottom -->

        </footer>
        <!-- End of Footer -->

        <div id="popup-article" class="popup" style="z-index: 9999">
                <div class="popup__block">
                        <h1 class="popup__title text-info">正在提问</h1>

                        <form action="{:url('index/question/save')}" method="post">
                                <div class="control-group info">
                                        <div class="control-group success">
                                                <div class="controls" style="text-align: center">
                                                        <label class="control-label" style="font-size: 20px">问题标题</label>
                                                        <input name="title" id="inputInfo" class="input-xxlarge" type="text" placeholder="问题标题" style="height: 40px">
                                                </div>
                                        </div>
                                </div>

                                <div class="control-group info">
                                        <div class="control-group success">
                                                <div class="controls" style="text-align: center">
                                                        <label class="control-label" style="font-size: 20px">问题分类</label>
                                                        <select name="cid" class="span3 text-info info" style="height: 40px;width: 530px;">
                                                                {volist name="namelist" id="v"}
                                                                <option value="{$v['id']}">{$v['name']}</option>
                                                                {/volist}
                                                        </select>
                                                </div>
                                        </div>
                                </div>

                                <div class="control-group info">
                                        <div class="control-group success">
                                                <div class="controls" style="text-align: center">
                                                        <label class="control-label" style="font-size: 20px">问题描述</label>
                                                        <div style="margin:auto;width:500px;">
                                                                <script type="text/plain" id="myQuestion" style="height:240px;"></script>
                                                            <div class="clear"></div>
                                                        </div>
                                                </div>
                                        </div>
                                </div>

                                <div class="control-group info">
                                        <div class="control-group success">
                                                <div class="controls" style="text-align: center">
                                                        <input type="submit" class="btn btn-large btn-info" type="button" style="text-align: center;" value="提交问题">
                                                </div>
                                        </div>
                                </div>
                        </form>

                        <a href="#" class="popup__close">关闭</a>
                </div>
        </div>




        <div class="nav-main" style="left: -100px; padding:38px 0 12px;height: auto;top: 8% ;border-radius:52px; ">
                <a href="javascript:$('.nav-main').animate({left:'0'}).children('#open-nav').css('display', 'none').next().css('display', 'inline-block');" style="display: inline-block; position: absolute;top: 46%;right: -26px;padding:10px 6px;background-color: #19a7f0;border-radius: 3px;" id="open-nav">展<br>开</a>
                <a href="javascript:$('.nav-main').animate({left:'-100px'}).children('#open-nav').css('display', 'inline-block').next().css('display', 'none');" style="display: none; position: absolute;top: 46%;right: -26px;padding:10px 6px;background-color: #19a7f0;border-radius: 3px;">隐<br>藏</a>
                <div class="nav-box">
                        <div class="nav">
                                <ul class="nav-ul">
                                        <li><a href="{:url('index/index/index')}" class="home"><span>首页</span></a></li>
                                        {volist name="namelist" id="v"}
                                        <li style="padding: 12px 0;"><a href="{:url('index/question/index',['class'=>$v['id']])}" ><span>{$v['name']}</span></a></li>
                                        {/volist}
                                </ul>
                        </div>
                </div>
        </div>
                                                            <!-- 机器人 -->
                                                            <div style="position: fixed;right: -220px;top: 28%;border-radius: 12px;width: 220px;padding:12px 6px;background: #eee;" class="nav-robot">
                                                                <a href="javascript:$('.nav-robot').animate({right:'0px'}).children('#open-nav').css('display', 'none').next().css('display', 'inline-block');" style="display: inline-block; position: absolute;top: 46%;left: -26px;padding:10px 6px;background-color: #19a7f0;border-radius: 3px;" id="open-nav">机<br>器<br>人</a>
                                                                <a href="javascript:$('.nav-robot').animate({right:'-220px'}).children('#open-nav').css('display', 'inline-block').next().css('display', 'none');" style="display: none; position: absolute;top: 46%;left: -26px;padding:10px 6px;background-color: #19a7f0;border-radius: 3px;">隐<br>藏</a>
                                                                <div style="margin-bottom: 6px;text-align: center;color: #CC96F5;">百科机器人</div>
                                                                <div style="overflow: hidden;">
                                                                <div id="bot-content" style="margin-right: -20px;padding:6px; height: 360px;background: #fff;border-radius: 6px;overflow-y: scroll;overflow-x: hidden;">
                                                                <div style="width: 120px;overflow: hidden;">
                                                                <p style="float:left;font-size: 12px; background: #eee;padding: 3px 8px;border-radius: 5px;">你好呀~<br>我是小百科爸爸<br>也可以帮你解答问题哦~</p>
                                                            </div>
                                                            </div>
                                                            </div>
                                                            <input type="text" id="bot-input" style="display: block; margin:5px auto;width: 90%;border-radius: 3px" placeholder="这里可以输入您的问题哦~">
                                                                </div>


                                                                <!-- 提醒框 -->
        <div class="tips-Modals" style="position: fixed;left: 0;bottom: 18%;display: none; border-radius: 3px;padding: 10px 32px;line-height: 36px;min-height: 36px;background-color: rgba(13, 210, 19, 0.85);color: #eee;font-size: 16px;box-shadow: 0 0 2px 3px #ED1;z-index: 9999999;">
            我是提示框测试数据哦
        </div>

        <script type="text/javascript">
            botuid = Date.parse(new Date());
            $("#bot-input").keyup(function(){
                if(event.keyCode == 13){
                    if ($('#bot-input').attr('value') == '') {
                        $('#bot-input').attr('placeholder','请输入内容呦')
                    }else{
                        ajaxBot();
                    }
                }
            });
            ajaxBot = function (){
                var text = $('#bot-input').attr('value');
                $('#bot-input').attr('value','');

                $("#bot-content").append('<div style="margin:6px 0 6px 100px;width: 120px;overflow: hidden;"><p style="margin-right: 24px;float: right; background: #eee;padding: 3px 8px;border-radius: 5px;font-size: 12px;">'+text+'</p></div>');
                $.ajax({
                    type: 'post',
                    data: {
                        key:'4e8e067e02b0421d99aa910d2b72ef28',
                        userid:botuid,
                        info:text
                    },
                    url: 'http://www.tuling123.com/openapi/api',
                    success: function (data) {
                        console.log(data.text);
                        $("#bot-content").append('<div style="width: 120px;overflow: hidden;"><p style="float:left; background: #eee;padding: 3px 8px;border-radius: 5px;font-size: 12px;">'+(data.text)+'</p></div>');
                        $('#bot-content').scrollTop( $('#bot-content')[0].scrollHeight );
                    },
                    error: function () {
                        alert('执行失败，请重试');
                    }
                });
            }
            
            ajaxTips = function (cont, color){
                if (!color) {
                    $('.tips-Modals').css('background-color',color);                
                }
                // 写入提示内容并展示，2000ms淡出隐藏
                $('.tips-Modals').html(cont);
                $('.tips-Modals').fadeIn();
                $('.tips-Modals').fadeOut(3600);
            }
        </script>

        <script type="text/javascript">
            //实例化编辑器
            var umw = UM.getEditor('myQuestion');
        </script>

        <script type="text/javascript">
                // 判断内容溢出
              $('.showContent').prev("p").each(function (i){
                console.log(666);
                if($(this).height() > 100){
                  $(this).next('.showContent').css('display','block');
                  $(this).addClass('hiddens');
                } 
              });
              // 展示问题内容
              $('.showContent').click(function(){
                  $(this).prev("p").removeClass('hiddens');
                  $(this).css('display','none');
                }
              );
        </script>

    <span style="display: none;" id="LoginURL" url="{:url('index/Login/index')}"></span>
</body>
</html>
